package com.cc.sanjieduan.mapper;

import com.cc.sanjieduan.pojo.Role;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface RoleMapper {

    @Select("SELECT * FROM sys_role WHERE role_id =#{role_id} ")
    Role selectRoleById(Long id);

    @Select("SELECT * FROM sys_role")
    List<Role> selectAllRoles();

    @Select("SELECT role_id FROM sys_user_role WHERE user_id =#{userId}")

    List<Long> selectRoleIdByUserId(Long userId);

    @Select("SELECT menu_id FROM sys_role_menu WHERE role_id =#{roleId}")
    List<Long> selectMenuIdByRoleId(Long roleId);
}
